package com.dingwen.frates.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.dingwen.frame.constant.ValidationGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author dingwen
 * @since 2021-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user")
@ApiModel(value="SysUser对象", description="系统用户表")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户ID，主键")
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(groups = ValidationGroups.Modify.class,message = "更新时主键不能为空")
    private Long id;

    @ApiModelProperty(value = "用户名")
    private String name;

    @ApiModelProperty(value = "年龄")
    @Max(value = 200,message = "年龄必须小于等于200")
    @Min(value = 0,message = "年龄必须大于等于0")
    private Integer age;

    @ApiModelProperty(value = "邮箱")
    @Email
    private String email;

    @ApiModelProperty(value = "该用户直属上级用户ID")
    private Long managerId;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @FutureOrPresent
    private LocalDateTime createTime;

    @ApiModelProperty(value = "逻辑删除标识,0-未删除,1-已删除")
    private Integer deleted;

    @ApiModelProperty(value = "版本")
    private Integer version;


}
